<template>
	<h1>Admin</h1>
</template>
<script>
export default{
	data(){
		return {
			name:"Henry"
		}
	},
	beforeRouteEnter:(to,from,next)=>{
		// alert('Hello ' + this.name);
		next(vm=>{
			alert('Hello ' + vm.name);
		});
	},
	beforeRouteLeave (to, from, next) {
	   // 导航离开该组件的对应路由时调用
	   // 可以访问组件实例 `this`
	   if(confirm('确定离开吗')==true){
	   		next();
	   }else{
	   		next(false);
	   }
	}
}
</script>